package com.xuexuehai.carrecommand.dao;

import com.xuexuehai.carrecommand.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IUserDao extends JpaRepository<User,Integer> {
    List<User> findUserByUsername(String username);
    User findUserByUsernameAndPassword(String username, String password);


    @Query(value = "SELECT user_username FROM user_tab" ,nativeQuery = true)
    List<String> findAllUsername(String username);

}
